<?php
/************************************ Theme Shortcodes ************************************/

// shortcodes: full width
function oneHalf( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_6 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneHalfLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_6 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function oneThird( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_4 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneThirdMid( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_4" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneThirdLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_4 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function twoThirds( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_8 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function twoThirdsLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_8 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function oneFourth( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_3 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneFourthMid( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_3" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneFourthLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_3 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function threeFourth( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_9 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function threeFourthLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_9 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

// shortcodes: content
function oneHalfContent( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_4 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneHalfContentLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_4 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function oneThirdContent( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="onethird alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneThirdContentMid( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="onethird" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneThirdContentLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="onethird omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function twoThirdsContent( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="twothirds alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function twoThirdsContentLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="twothirds omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function oneFourthContent( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_2 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneFourthContentMid( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_2" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function oneFourthContentLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_2 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function threeFourthContent( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_6 alpha" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

function threeFourthContentLast( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	$allowed_alignments = array( 'left', 'center', 'right', 'justify' );
	return '<div class="grid_6 omega" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

// shortcodes: warnings
function warningBlue( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	return '<div class="alertblue" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function warningYellow( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	return '<div class="alertyellow" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function warningGreen( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	return '<div class="alertgreen" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

function warningRed( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	return '<div class="alertred" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div><div class="clear">&nbsp;</div>';
}

// shortcodes: blocquotes
function bigBlockquote( $atts, $content = NULL ) {
	extract( shortcode_atts( array( 'textalign' => '' ), $atts ) );
	return '<div class="bigblockquotes" style="text-align: ' . $textalign . ';"><p>' . do_shortcode( $content ) . '</p></div>';
}

// shortcodes: highlights
function hlBlue( $atts, $content = NULL ) {
	return '<span class="hlblue">' . do_shortcode( $content ) . '</span>';
}
function hlRed( $atts, $content = NULL ) {
	return '<span class="hlred">' . do_shortcode( $content ) . '</span>';
}
function hlInverse( $atts, $content = NULL ) {
	return '<span class="hlinverse">' . do_shortcode( $content ) . '</span>';
}

// shortcodes: separator
function separator( $atts, $content = NULL ) {
	return '<span class="separator">&nbsp;</span>' . do_shortcode( $content );
}

// shortcodes: stronger
function stronger( $atts, $content = NULL ) {
	return '<span class="stronger">' . do_shortcode( $content ) . '</span>';
}

// shortcodes: icons
function iconAdvertising( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/advertising.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconBasket( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/basket.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconCheck( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/check.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconCommunicate( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/communication.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconContact( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/contact.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconIssue( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/issue.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconPencil( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/pencil.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconSpecialoffer( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/specialoffer.png' ) . '" alt="" />' . do_shortcode( $content );
}
function iconStar( $atts, $content = NULL ) {
	return '<img class="icon" src="' . get_template_directory_uri() . ( '/images/icons/star.png' ) . '" alt="" />' . do_shortcode( $content );
}

add_shortcode( "one_half_wide", "oneHalf" );
add_shortcode( "one_half_wide_last", "oneHalfLast" );
add_shortcode( "one_third_wide", "oneThird" );
add_shortcode( "one_third_wide_mid", "oneThirdMid" );
add_shortcode( "one_third_wide_last", "oneThirdLast" );
add_shortcode( "two_thirds_wide", "twoThirds" );
add_shortcode( "two_thirds_wide_last", "twoThirdsLast" );
add_shortcode( "one_fourth_wide", "oneFourth" );
add_shortcode( "one_fourth_wide_mid", "oneFourthMid" );
add_shortcode( "one_fourth_wide_last", "oneFourthLast" );
add_shortcode( "three_fourth_wide", "threeFourth" );
add_shortcode( "three_fourth_wide_last", "threeFourthLast" );

add_shortcode( "one_half_narrow", "oneHalfContent" );
add_shortcode( "one_half_narrow_last", "oneHalfContentLast" );
add_shortcode( "one_third_narrow", "oneThirdContent" );
add_shortcode( "one_third_narrow_mid", "oneThirdContentMid" );
add_shortcode( "one_third_narrow_last", "oneThirdContentLast" );
add_shortcode( "two_thirds_narrow", "twoThirdsContent" );
add_shortcode( "two_thirds_narrow_last", "twoThirdsContentLast" );
add_shortcode( "one_fourth_narrow", "oneFourthContent" );
add_shortcode( "one_fourth_narrow_mid", "oneFourthContentMid" );
add_shortcode( "one_fourth_narrow_last", "oneFourthContentLast" );
add_shortcode( "three_fourth_narrow", "threeFourthContent" );
add_shortcode( "three_fourth_narrow_last", "threeFourthContentLast" );

add_shortcode( "alert_blue", "warningBlue" );
add_shortcode( "alert_yellow", "warningYellow" );
add_shortcode( "alert_green", "warningGreen" );
add_shortcode( "alert_red", "warningRed" );

add_shortcode( "big_blockquote", "bigBlockquote" );

add_shortcode( "hl_blue", "hlBlue" );
add_shortcode( "hl_red", "hlRed" );
add_shortcode( "hl_inverse", "hlInverse" );

add_shortcode( "separator", "separator" );

add_shortcode( "stronger", "stronger" );

add_shortcode( "icon_advertising", "iconAdvertising" );
add_shortcode( "icon_basket", "iconBasket" );
add_shortcode( "icon_check", "iconCheck" );
add_shortcode( "icon_communicate", "iconCommunicate" );
add_shortcode( "icon_contact", "iconContact" );
add_shortcode( "icon_issue", "iconIssue" );
add_shortcode( "icon_pencil", "iconPencil" );
add_shortcode( "icon_specialoffer", "iconSpecialoffer" );
add_shortcode( "icon_star", "iconStar" );